package edu.nf.llmtest.model.document;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;

/**
 * @ Author bin
 * @ Create  2025/11/7 11:45
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "llm_essay" , createIndex = false)
public class EssayDoc {
    /**
     * 文章id
     * */
    @Id
    private Integer eId;

    /**
     * 作者信息
     * */
    private UserDoc user;

    /**
     * 文章类型列表
     * */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    List<String> types;

    /**
     * 文章标题
     * */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String title;

    /**
     * 文章内容
     * */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String content;

    /**
     * 状态
     * */
    @Field(type = FieldType.Text)
    private String status;


    /**
     * 文章图片 不参与检索
     * 示例 ：http://120.79.239.188/zjl.jpg, http://120.79.239.188/tfs.jpg, http://120.79.239.188/wty.jpg, http://120.79.239.188/zjl.jpg
     * */
    @Field(type = FieldType.Keyword,index = false)
    private List<String> images;

    /**
     * 发布时间
     * */
    @Field(type = FieldType.Keyword)
    private String createTime;
}
